package com.company.ems.dto;

import java.util.List;

public class PageDTO<T> {
    private List<T> data;
    private Integer currentPage;
    private Integer pageSize;
    private Integer totalCount;
    private Integer totalPage;


    public PageDTO(List<T> data, Integer currentPage, Integer pageSize, Integer totalCount) {
        this.data = data;
        this.currentPage = currentPage;
        this.pageSize = pageSize;
        this.totalCount = totalCount;
        this.totalPage = (totalCount + pageSize - 1) / pageSize;
    }


    public List<T> getData() { return data; }
    public void setData(List<T> data) { this.data = data; }
    public Integer getCurrentPage() { return currentPage; }
    public void setCurrentPage(Integer currentPage) { this.currentPage = currentPage; }
    public Integer getPageSize() { return pageSize; }
    public void setPageSize(Integer pageSize) { this.pageSize = pageSize; }
    public Integer getTotalCount() { return totalCount; }
    public void setTotalCount(Integer totalCount) { this.totalCount = totalCount; }
    public Integer getTotalPage() { return totalPage; }
    public void setTotalPage(Integer totalPage) { this.totalPage = totalPage; }
}